from crv.tools.statemachinemgr import StateMachineMgr
from crv.model.crvmodel import Cluster

a=Cluster()
b=StateMachineMgr()

b.addNodes(Cluster.SCname.keys())
b.addEdge(Cluster.SC.SC_UNINITIALIZED, Cluster.SC.SC_INITIALIZED)
b.addEdge(Cluster.SC.SC_INITIALIZED,   Cluster.SC.SC_STARTING)
b.addEdge(Cluster.SC.SC_STARTING,      Cluster.SC.SC_STARTED)
b.addEdge(Cluster.SC.SC_STARTING,      Cluster.SC.SC_EXCEPTION)
b.addEdge(Cluster.SC.SC_STARTED,       Cluster.SC.SC_STOPPING)
b.addEdge(Cluster.SC.SC_STARTED,       Cluster.SC.SC_DEGRADED)
b.addEdge(Cluster.SC.SC_STARTED,       Cluster.SC.SC_EXCEPTION)
b.addEdge(Cluster.SC.SC_DEGRADED,      Cluster.SC.SC_STARTED)
b.addEdge(Cluster.SC.SC_DEGRADED,      Cluster.SC.SC_STOPPING)
b.addEdge(Cluster.SC.SC_STOPPING,      Cluster.SC.SC_DEGRADED)
b.addEdge(Cluster.SC.SC_STOPPING,      Cluster.SC.SC_INITIALIZED)
b.addEdge(Cluster.SC.SC_STOPPING,      Cluster.SC.SC_EXCEPTION)
b.addEdge(Cluster.SC.SC_EXCEPTION,     Cluster.SC.SC_FIXING)
b.addEdge(Cluster.SC.SC_FIXING,        Cluster.SC.SC_INITIALIZED)

